<!--组合管理-->
<template>
  <div class="app-container flex-cloumn">
    <el-form :model="queryParams" ref="tradeProfitQueryRef">
      <el-row :gutter="12">
        <el-col :span="4">
          <el-form-item label="组合">
            <el-input
                v-model="queryParams.groupName"
                placeholder="请输入组合"
                clearable
                :style="{width: '100%'}"
                size="small"
            />
          </el-form-item>
        </el-col>
        <el-col :span="1.5">
          <el-button type="primary"
                     style="margin: 3px 3px"
                     :loading="loading" icon="Search"
                     size="small"
                     v-hasPermi="['risk:profitmanage:profitinfo:list']"
                     @click="handleInfoQuery">搜索
          </el-button>
        </el-col>
      </el-row>
    </el-form>

    <el-row :gutter="12" style="margin: 0px 1px">

      <el-button
          type="primary"
          style="margin: 3px 3px"
          icon="Plus"
          size="small"
          @click="handleAdd"
          v-hasPermi="['risk:profitmanage:profitinfo:add']"
      >新增
      </el-button>
      <el-button
          type="success"
          style="margin: 3px 3px"
          icon="Edit"
          size="small"
          :disabled="single||btnFlag"
          @click="handleUpdate"
          v-hasPermi="['risk:profitmanage:profitinfo:edt']"
      >修改
      </el-button>
      <el-button
          type="danger"
          style="margin: 3px 3px"
          icon="Delete"
          size="small"
          :disabled="single||btnFlag || alloFlag"
          @click="handleDelete"
          v-hasPermi="['risk:profitmanage:profitinfo:del']"
      >删除
      </el-button>
      <el-button
          type="danger"
          style="margin: 3px 3px"
          icon="Edit"
          size="small"
          :disabled="single||btnFlag"
          @click="handelGroupBalance"
          v-hasPermi="['risk:profitmanage:profitinfo:exec']"
      >执行
      </el-button>
      <el-button
          type="danger"
          style="margin: 3px 3px"
          icon="Edit"
          size="small"
          :disabled="single||btnFlag||alloFlag"
          @click="handleUpdateAllocate"
          v-hasPermi="['risk:profitmanage:profitinfo:allocate']"
      >授权
      </el-button>
    </el-row>
    <xTable v-loading="loading" :data="profitInfoList" multiple="false"
            ref="refGroupTable" refId="refGroupTable" class="tableDragger_form"
            @selection-change="handleSelectionChange">
      <template #columList>
        <el-table-column label="序号" type="index" width="50">
        </el-table-column>
        <el-table-column label="组合编号" align="center" prop="groupId" width="120" v-if="false"/>
        <el-table-column label="组合编号" align="center" prop="groupCode" width="120"/>
        <el-table-column label="组合名称" align="center" prop="groupName" width="120"/>
        <el-table-column label="组合配置" align="center" width="120">
          <template #default="scope">
            <el-button
                type="text"
                icon="View"
                @click="handleView(scope.row)"
                v-hasPermi="['risk:profitmanage:profitinfo:view']"
            >查看
            </el-button>
          </template>
        </el-table-column>
        <el-table-column label="组合配置" align="center" prop="groupSchema" width="120" v-if="false"/>
        <el-table-column label="创建人" align="center" prop="userName" width="120"/>
        <el-table-column label="备注" align="center" prop="remark"/>
      </template>
    </xTable>
    <pagination
        style="margin:20px 0 20px 0"
        :total="total"
        v-model:page="queryParams.pageNum"
        v-model:limit="queryParams.pageSize"
        @pagination="getList"
    />
    <!-- 添加或修改参数配置对话框 -->
    <el-dialog :title="title" v-model="profitInfoOpen" width="30%" :close-on-click-modal="false" draggable="true"
               destroy-on-close>
      <el-form ref="profitInfoRef" :model="form" :rules="rules" :disabled="viewFlag" label-width="80px" size="small">
        <el-row :gutter="10">
          <el-col :span="24">
            <el-form-item label="组合类型" prop="groupType">
              <dictCombox v-model="form.groupType"
                          dictType="groupType" disabled="true"
                          :style="{width: '100%'}"></dictCombox>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="组合id" prop="groupId" v-show="false">
              <el-input v-model="form.groupId" clearable size="small" disabled=""
                        placeholder="请输入组合编号"/>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="组合编号" prop="groupCode">
              <el-input v-model="form.groupCode" :disabled="groupCodeDisabled" clearable size="small" maxlength="20"
                        placeholder="请输入组合编号"/>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="组合名称" prop="groupName">
              <el-input v-model="form.groupName" :disabled="groupNameDisabled" clearable size="small" maxlength="20"
                        placeholder="请输入组合名称"/>
            </el-form-item>
          </el-col>

          <!-- <el-col :span="24">
            <el-form-item label="授权" >
              <TreeMultipleSelect
                    v-model="form.allocateDeptAndUser"
                    :check= "handleAllocateTreeSelection"
                    v-show="formShow.allocateDeptAndUser"
                    :options="deptUserOptions"
                    style="width:100%"
                    :node-click="handleNodeClick"
                    placeholder="请选择授权用户"
                    :objMap="{ value: 'id', label: 'label', type: 'type',children: 'children' }"/>
            </el-form-item>
          </el-col> -->
          <el-col :span="24" v-if="formShow.allocateDeptAndUser">
            <el-form-item label="权限分配">
              <el-tree
                  class="tree-border"
                  :data="deptUserOptions"
                  show-checkbox
                  :default-expanded-keys="defaultUser"
                  ref="deptUserPermRef"
                  :default-checked-keys="workmates"
                  node-key="id"
                  destroy-on-close
                  @check-change="checkChange"
                  :default-expand-all="deptUserPermExpend"
                  empty-text="加载中，请稍候"
                  :props="{ label: 'label',type:'type', children: 'children' }"
              ></el-tree>
            </el-form-item>
          </el-col>

          <el-divider></el-divider>

          <template v-if="formShow.groupSchema">
            <el-col :span="24">
              <el-form-item label="期权类型">
                <dictCombox v-model="form.optionTypes"  multiple collapse-tags collapse-tags-tooltip dictType="optionType" size="small"></dictCombox>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="标的代码" prop="underlyerId">
                <baseCombox url="/marketdata/instrument/getInstruments.action" clearable
                            size="small"
                            multiple collapse-tags collapse-tags-tooltip
                            valueField="code"
                            labelField="productName" placeholder="标的代码"
                            v-model="form.underlyerIds"></baseCombox>

              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="本方账户" prop="accIds">
                <baseCombox url="/trade/account/querySelfAccountCombox.action" clearable multiple
                            size="small" collapse-tags collapse-tags-tooltip
                            valueField="accId" labelField="accName" placeholder="本方账户"
                            v-model="form.accIds"></baseCombox>
              </el-form-item>
            </el-col>

            <el-col :span="24">
              <el-form-item label="交易对手" prop="partyId">
                <baseCombox url="/trade/counterparty/queryCounterparty4Combox.action" clearable multiple
                            size="small" collapse-tags collapse-tags-tooltip
                            valueField="partyId" labelField="partyName" placeholder="交易对手"
                            v-model="form.accIdCps"></baseCombox>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="起始日1">
                <el-col :span="6">
                <el-checkbox name="status" false-label="0" true-label="1" @change="begDate1FlagChange" v-model="form.begDate1Flag">跟随系统</el-checkbox>
                </el-col>
                <el-col :span="18">
                <el-date-picker
                    v-model="form.begDate1"
                    type="date"
                    :style="{width: '100%'}" :disabled="form.begDate1Flag=='1'"
                    value-format="YYYY-MM-DD"
                    placeholder="选择日期">
                </el-date-picker>
                </el-col>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="起始日2">
                <el-col :span="6">
                <el-checkbox name="status" false-label="0" true-label="1"  @change="begDate2FlagChange" v-model="form.begDate2Flag">跟随系统</el-checkbox>
                </el-col>
                <el-col :span="18">
                <el-date-picker
                    v-model="form.begDate2"  :disabled="form.begDate2Flag=='1'"
                    type="date"
                    :style="{width: '100%'}"
                    value-format="YYYY-MM-DD"
                    placeholder="选择日期">
                </el-date-picker>
                </el-col>
              </el-form-item>
            </el-col>
            <el-col :span="24">

              <el-form-item label="到期日1">
                <el-col :span="6">
                  <el-checkbox change name="status" false-label="0" true-label="1"  @change="endDate1FlagChange" v-model="form.endDate1Flag">跟随系统</el-checkbox>
                </el-col>
                <el-col :span="18">
                <el-date-picker
                    v-model="form.endDate1"
                    type="date"
                    :style="{width: '100%'}"  :disabled="form.endDate1Flag=='1'"
                    value-format="YYYY-MM-DD"
                    placeholder="选择日期">
                </el-date-picker>
                </el-col>
              </el-form-item>
              </el-col>

            <el-col :span="24">

              <el-form-item label="到期日2">
                <el-col :span="6">
                  <el-checkbox name="status" false-label="0" true-label="1" @change="endDate2FlagChange" v-model="form.endDate2Flag">跟随系统</el-checkbox>
                </el-col>
                <el-col :span="18">
                <el-date-picker
                    v-model="form.endDate2"  :disabled="form.endDate2Flag=='1'"
                    type="date"
                    :style="{width: '100%'}"
                    value-format="YYYY-MM-DD"
                    placeholder="选择日期">
                </el-date-picker>
                </el-col>
              </el-form-item>
            </el-col>

            <el-col :span="24">
              <el-form-item label="备注">
                <el-input
                    v-model="form.remark"
                    :rows="2"
                    type="textarea"
                    maxlength="300"
                    placeholder="备注"
                />
              </el-form-item>
            </el-col>
          </template>

        </el-row>
      </el-form>
      <template #footer>
        <div class="dialog-footer">
          <el-button v-show="!viewFlag" type="primary" @click="submitForm">确 定</el-button>
          <el-button @click="cancel">取 消</el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>

<script setup name="ProfitInfo">
import xTable from "../../../../xquant/base/xTable";
import {
  getProfitInfoList,
  addProfitInfo,
  uptProfitInfo,
  delProfitInfo,
  getGroupBalance,
  execGroupBalance,
  getGroupUserAndDpetPerm,
  updateGroupPerm
} from "@/api/risk/profitmanage/profitinfo";
import dictCombox from "../../../../xquant/base/dictCombox"
import {isVoid, isNotVoid} from "@/utils/util";
import {treeselectuser} from "@/api/system/dept";

const {proxy} = getCurrentInstance();
import {nextTick, ref, watch} from "vue";

const profitInfoList = ref([]);
const showSearch = ref(true);
const profitInfoOpen = ref(false);
const loading = ref(false);
const selectObj = ref([]);
const total = ref(0);
const single = ref(true);
const multiple = ref(true);
const title = ref("");
const opFlag = ref(false);//true时为修改  false为新增
const btnFlag = ref(true);
const viewFlag = ref(false);
const groupCodeDisabled = ref(false);
const groupNameDisabled = ref(false);
const alloFlag = ref(true);
import store from '@/store'

const defaultUser = ref(['u:' + store.getters.user.userId])

const deptUserPermRef = ref(undefined);
const deptUserOptions = ref(undefined);
const deptUserPermExpend = ref(false);

const workmates = ref([]);

const data = reactive({
  form: {
    groupType: 'trade',
    groupCode: undefined,
    groupName: '',
    optionTypes: undefined,
    allocateDeptAndUser: [],
    accIdCps: undefined,
    accIds: undefined,
    // iCode: undefined,
    underlyerIds: undefined,
    groupId: undefined,
    remark: undefined
  },
  queryParams: {
    groupName: undefined,
    pageNum: 1,
    pageSize: 10
  },
  rules: {
    grouType: [{required: true, message: "组合类型不能为空", trigger: "blur"}],
    groupCode: [{required: true, message: "组合编号不能为空", trigger: "blur"}],
    groupName: [{required: true, message: "组合名称不能为空", trigger: "blur"}],
  },
  formShow: {
    groupType: true,
    groupCode: true,
    groupName: true,
    optionTypes: true,
    allocateDeptAndUser: true,
    accIdCps: true,
    accIds: true,
    // iCode: undefined,
    underlyerIds: true,
    groupId: true,
    remark: true,
  }

});
const {form, queryParams, rules, formShow} = toRefs(data);

/** 表单重置 */
function reset() {
  form.value = {
    groupType: 'trade',
    groupCode: undefined,
    groupName: undefined,
    groupId: undefined,
    optionTypes: undefined,
    allocateDeptAndUser: undefined,
    accIdCps: undefined,
    accIds: undefined,
    // iCode: undefined,
    underlyerIds: undefined,
    remark: undefined,
    begDate1: undefined,
    begDate1Flag:'0',
    begDate2Flag:'0',
    endDate1Flag:'0',
    endDate2Flag:'0',
    begDate2: undefined,
    endDate1: undefined,
    endDate2: undefined,
  };
}

watch(() => form.value.begDate1, (newVal, oldVal) => {
  if (isNotVoid(newVal) && isNotVoid(form.value.begDate2)) {
    let a = proxy.$moment(newVal)
    let b = proxy.$moment(form.value.begDate2)
    if (a > b) {
      form.value.begDate2 = newVal;
    }
  }
})
watch(() => form.value.begDate2, (newVal, oldVal) => {
  if (isNotVoid(newVal) && isNotVoid(form.value.begDate1)) {
    let b = proxy.$moment(newVal)
    let a = proxy.$moment(form.value.begDate1)
    if (a > b) {
      form.value.begDate1 = newVal;
    }
  }
})
watch(() => form.value.endDate1, (newVal, oldVal) => {
  if (isNotVoid(newVal) && isNotVoid(form.value.endDate2)) {
    let a = proxy.$moment(newVal)
    let b = proxy.$moment(form.value.endDate2)
    if (a > b) {
      form.value.endDate2 = newVal;
    }
  }
})
watch(() => form.value.endDate2, (newVal, oldVal) => {
  if (isNotVoid(newVal) && isNotVoid(form.value.endDate1)) {
    let b = proxy.$moment(newVal)
    let a = proxy.$moment(form.value.endDate1)
    if (a > b) {
      form.value.endDate1 = newVal;
    }
  }
})

/** 查询列表 */
function getList() {
  loading.value = true;
  getProfitInfoList(queryParams.value).then(response => {
    profitInfoList.value = response.list;
    total.value = response.total;
    loading.value = false;
  });
}

/** 查询部门用户下拉树结构 */
function getTreeselectuser() {
  treeselectuser().then(response => {
    deptUserOptions.value = response.data;
  });

};

/**获取当前选中的所有节点 */
function getAllCheckedDeptAndUsers() {
  var checkedBox = deptUserPermRef.value.getCheckedNodes();
  var halfCheckedBox = deptUserPermRef.value.getHalfCheckedNodes();
  var valueIDArrs = []
  var valueTitleArrs = []
  checkedBox.forEach(element => {
    valueIDArrs.push(element.id);
    valueTitleArrs.push(element.label)
  })
  halfCheckedBox.forEach(element => {
    valueIDArrs.push(element.id);
    valueTitleArrs.push(element.label)
  })
  form.value.allocateDeptAndUser = valueIDArrs.join(",")

}


function handleAllocateTreeSelection(data) {
}

function handleNodeClick(node) {
}

/** 搜索按钮操作 */
function handleInfoQuery() {
  queryParams.value.pageNum = 1;
  btnFlag.value = false;
  getList();
}

/** 新增按钮操作 */
function handleAdd() {
  reset();
  defaultUser.value = ['u:' + store.getters.user.userId];
  let tempWorkMates = [];
  let a = proxy.treeFindPath(deptUserOptions.value,node => {
    if(node.id == defaultUser.value){
      return true;
    }
  });
  a[a.length -2].children.forEach(item => {
    if(item.id.search("u:") != -1){
      tempWorkMates.push(item.id);
    }
  })
  workmates.value = tempWorkMates;
  groupCodeDisabled.value = false;
  groupNameDisabled.value = false;
  deptUserPermExpend.value = false;
  formShow.value.allocateDeptAndUser = true;
  formShow.value.groupSchema = true;
  form.value.ircCode = queryParams.value.ircCode;
  opFlag.value = false;
  profitInfoOpen.value = true;
  viewFlag.value = false;
  title.value = "添加组合";
}

/** 授权按钮操作 */
function handleUpdateAllocate() {
  reset();
  defaultUser.value = ['u:' + store.getters.user.userId];
  workmates.value = [];
  groupCodeDisabled.value = true;
  groupNameDisabled.value = true;
  deptUserPermExpend.value = true;
  formShow.value.allocateDeptAndUser = true;
  formShow.value.groupSchema = false;
  viewFlag.value = false;
  let param = selectObj.value;
  if (param.length > 0) {
    param = param[0];
  }

  const arrs = getGroupUserAndDpetPerm(param).then(response => {

    return response;
  })
  getProfitInfoList(param).then(response => {
    form.value = response.list[0];
    profitInfoOpen.value = true;
    opFlag.value = true;
    title.value = "修改组合授权";
    //回显
    nextTick(() => {
      arrs.then((res) => {
        res.forEach((element) => {
          nextTick(() => {
            deptUserPermRef.value.setChecked(element, true, false)
          })
        })
      })
    });
  });

}


/** 取消按钮 */
function cancel() {
  profitInfoOpen.value = false;
  reset();
}

/** 多选框选中数据 */
function handleSelectionChange(selection) {
  selectObj.value = selection.map(item => {
    return {'groupId': item.groupId};
  });
  single.value = selection.length != 1;
  multiple.value = !selection.length;
  if (selection.length == 1) {
    alloFlag.value = false;
  } else {
    alloFlag.value = true;
  }
}

/** 修改按钮操作 */
function handleUpdate(row) {
  reset();
  groupCodeDisabled.value = true;
  formShow.value.allocateDeptAndUser = false;
  formShow.value.groupSchema = true;
  viewFlag.value = false;
  let param = selectObj.value;
  if (param.length > 0) {
    param = param[0];
  }
  getProfitInfoList(param).then(response => {
    form.value = response.list[0];
    let schemaParam=JSON.parse(form.value.groupSchema);
    if (typeof schemaParam.optionTypes == "undefined" || schemaParam.optionTypes == null || schemaParam.optionTypes == '') {
      schemaParam.optionTypes = null
    } else {
      schemaParam.optionTypes=proxy.lsh.split(schemaParam.optionTypes,',');
    }
    if (typeof schemaParam.accIdCps == "undefined" || schemaParam.accIdCps == null || schemaParam.accIdCps == '') {
      schemaParam.accIdCps = null
    } else {
      schemaParam.accIdCps= proxy.lsh.split(schemaParam.accIdCps,',');
    }
    if (typeof schemaParam.accIds == "undefined" || schemaParam.accIds == null || schemaParam.accIds == '') {
      schemaParam.accIds = null
    } else {
      schemaParam.accIds=proxy.lsh.split(schemaParam.accIds,',');
    }
    if (typeof schemaParam.underlyerIds == "undefined" || schemaParam.underlyerIds == null || schemaParam.underlyerIds == '') {
      schemaParam.underlyerIds = null
    } else {
      schemaParam.underlyerIds=proxy.lsh.split(schemaParam.underlyerIds,'|');
    }
    proxy.lsh.assign(form.value, schemaParam);
    profitInfoOpen.value = true;
    opFlag.value = true;
    title.value = "修改组合";
  });
}

/** 修改按钮操作 */
function handleView(row) {
  reset();
  groupCodeDisabled.value = true;
  groupNameDisabled.value = false;
  formShow.value.allocateDeptAndUser = false;
  formShow.value.groupSchema = true;
  getProfitInfoList(row).then(response => {
    form.value = response.list[0];
    let schemaParam=JSON.parse(form.value.groupSchema);
    if (typeof schemaParam.optionTypes == "undefined" || schemaParam.optionTypes == null || schemaParam.optionTypes == '') {
      schemaParam.optionTypes = null
    } else {
      schemaParam.optionTypes=proxy.lsh.split(schemaParam.optionTypes,',');
    }
    if (typeof schemaParam.accIdCps == "undefined" || schemaParam.accIdCps == null || schemaParam.accIdCps == '') {
      schemaParam.accIdCps = null
    } else {
      schemaParam.accIdCps= proxy.lsh.split(schemaParam.accIdCps,',');
    }
    if (typeof schemaParam.accIds == "undefined" || schemaParam.accIds == null || schemaParam.accIds == '') {
      schemaParam.accIds = null
    } else {
      schemaParam.accIds=proxy.lsh.split(schemaParam.accIds,',');
    }
    if (typeof schemaParam.underlyerIds == "undefined" || schemaParam.underlyerIds == null || schemaParam.underlyerIds == '') {
      schemaParam.underlyerIds = null
    } else {
      schemaParam.underlyerIds=proxy.lsh.split(schemaParam.underlyerIds,'|');
    }
    proxy.lsh.assign(form.value,schemaParam );
    profitInfoOpen.value = true;
    opFlag.value = true;
    viewFlag.value = true;
    title.value = "查看配置";
  });
}

/** 提交按钮 */
function submitForm() {
  proxy.$refs["profitInfoRef"].validate(valid => {
    if (valid) {
      let formData = {};
      let qryParam = proxy.lsh.cloneDeep(form.value);
      formData.groupId = qryParam.groupId;
      formData.groupName =qryParam.groupName;
      formData.groupCode = qryParam.groupCode;
      formData.groupType = qryParam.groupType;
      formData.remark = qryParam.remark;
      formData.groupSchema = JSON.stringify({
        'optionTypes': proxy.lsh.join(qryParam.optionTypes, ','),
        'accIdCps':  proxy.lsh.join(qryParam.accIdCps, ','),
        'accIds': proxy.lsh.join(qryParam.accIds, ','),
        'underlyerIds': proxy.lsh.join(qryParam.underlyerIds, '|'),
        'begDate1': qryParam.begDate1,
        'begDate1Flag':qryParam.begDate1Flag,
        'begDate2': qryParam.begDate2,
        'begDate2Flag':qryParam.begDate2Flag,
        'endDate1': qryParam.endDate1,
        'endDate1Flag':qryParam.endDate1Flag,
        'endDate2': qryParam.endDate2,
        'endDate2Flag':qryParam.endDate2Flag
      });
      if (opFlag.value == true && formShow.value.groupSchema == true) {
        uptProfitInfo(formData).then(response => {
          if(response.success){
            proxy.$modal.msgSuccess("修改成功");
            profitInfoOpen.value = false;
            getList();
          }else{
            proxy.$modal.msgError(response.msg);
          }


        });
      } else if (opFlag.value == false && formShow.value.groupSchema == true) {
        getAllCheckedDeptAndUsers();
        formData.allocateDeptAndUser = form.value.allocateDeptAndUser;
        addProfitInfo(formData).then(response => {
          if(response.success){
            proxy.$modal.msgSuccess("新增成功");
            profitInfoOpen.value = false;
            getList();
          }else{
            proxy.$modal.msgError(response.msg);
          }
        });
      }
      if (formShow.value.groupSchema == false) {
        //说明是授权操作
        getAllCheckedDeptAndUsers();
        formData.allocateDeptAndUser = form.value.allocateDeptAndUser;
        updateGroupPerm(formData).then(response => {
          proxy.$modal.msgSuccess("授权成功");
          profitInfoOpen.value = false;
          getList();
        })
      }


    }

  });
}

/** 删除按钮操作 */
function handleDelete(row) {
  let param = selectObj.value;
  if (param.length > 0) {
    param = param[0];
    getGroupBalance(proxy.lsh.assign(param, {'groupType': 'in'})).then(response => {
      if (response.list.length > 0) {
        proxy.$modal.alertError("组合内有交易，不能删除!");
      } else {
        deleteProfit(param);
      }
    });
  }
}

function checkChange(data, checkStatus, childStatus) {
  if (data.id === defaultUser.value[0]) {
    deptUserPermRef.value.setChecked(data, true, true);
  }
}

function deleteProfit(param) {
  proxy.$modal.confirm('是否确认删除这条数据？').then(function () {
    return delProfitInfo(param);
  }).then(() => {
    getList();
    proxy.$modal.msgSuccess("删除成功");
  }).catch(() => {
  });
}

/** 执行按钮操作 */
function handelGroupBalance() {
  let param = selectObj.value;
  if (param.length > 0) {
    param = param[0];
    execGroupBalance(param).then(response => {
      if (response.list.length > 0) {

      }
    });
    proxy.$modal.msgSuccess("任务执行成功!");
  }
}
/** 跟随系统 置灰相应组件 */
function begDate1FlagChange(){
  if(form.value.begDate1Flag=='1'){
    form.value.begDate1='';
  }
}
/** 跟随系统 置灰相应组件 */
function begDate2FlagChange(){
  if(form.value.begDate2Flag=='1'){
    form.value.begDate2='';
  }
}
/** 跟随系统 置灰相应组件 */
function endDate1FlagChange(){
  if(form.value.endDate1Flag=='1'){
    form.value.endDate1='';
  }
}
/** 跟随系统 置灰相应组件 */
function endDate2FlagChange(){
  if(form.value.endDate2Flag=='1'){
    form.value.endDate2='';
  }
}
getTreeselectuser();

handleInfoQuery();
</script>
